#ifndef ELEMENTS_ITEM_H
#define ELEMENTS_ITEM_H

#include "element.h"

namespace Elements
{

struct Item : public Element
{
    Item() = default;
    Item(const Item& other);

    // -- Интерфейс элемента -- //

    virtual bool isSame(Element* other) const override;

    virtual Common::Json toJson() const override;
    virtual void fromJson(const Common::Json& json) override;

    virtual Element* clone() const override;
    virtual ElementType elementType() const override;

    // -- Интерфейс данных -- //

    unsigned itemTypeId() const;
    void setItemTypeId(unsigned value);

    unsigned parentId() const;
    void setParentId(unsigned value);

    unsigned stateId() const;
    void setStateId(unsigned value);

    unsigned phaseId() const;
    void setPhaseId(unsigned value);

    std::string caption() const;
    void setCaption(const std::string& value);

    std::string description() const;
    void setDescription(const std::string& value);

    std::string searchCaption() const;
    void setSearchCaption(const std::string& value);

    std::string searchDescription() const;
    void setSearchDescription(const std::string& value);

private:
    unsigned m_itemTypeId = 0;
    unsigned m_parentId = 0;
    unsigned m_stateId = 0;
    unsigned m_phaseId = 0;
    std::string m_caption;
    std::string m_description;
    std::string m_searchCaption;
    std::string m_searchDescription;
};

typedef std::shared_ptr<Item> ItemPtr;
typedef std::vector<ItemPtr> Items;

} // namespace Elements

#endif // ELEMENTS_ITEM_H
